const INFO_KEY = 'smart_mall'
const HISTORY_KEY = 'history_list'
export const setInfo = (obj) => {
  localStorage.setItem(INFO_KEY, JSON.stringify(obj))
}
export const getInfo = (obj) => {
  const res = localStorage.getItem(INFO_KEY)
  return res
}
export const removeInfo = () => {
  localStorage.removeItem(INFO_KEY)
}
export const setHistory = (arr) => {
  localStorage.setItem(HISTORY_KEY, JSON.stringify(arr))
}
export const getHistory = () => {
  const result = JSON.parse(localStorage.getItem(HISTORY_KEY))
  return result || []
}
